// Verilated -*- C++ -*-
// DESCRIPTION: Verilator output: Design implementation internals
// See Vysyx_22040213_sext12to64.h for the primary calling header

#include "Vysyx_22040213_sext12to64___024root.h"
#include "Vysyx_22040213_sext12to64__Syms.h"

#include "verilated_dpi.h"

//==========


void Vysyx_22040213_sext12to64___024root___ctor_var_reset(Vysyx_22040213_sext12to64___024root* vlSelf);

Vysyx_22040213_sext12to64___024root::Vysyx_22040213_sext12to64___024root(const char* _vcname__)
    : VerilatedModule(_vcname__)
 {
    // Reset structure values
    Vysyx_22040213_sext12to64___024root___ctor_var_reset(this);
}

void Vysyx_22040213_sext12to64___024root::__Vconfigure(Vysyx_22040213_sext12to64__Syms* _vlSymsp, bool first) {
    if (false && first) {}  // Prevent unused
    this->vlSymsp = _vlSymsp;
}

Vysyx_22040213_sext12to64___024root::~Vysyx_22040213_sext12to64___024root() {
}

void Vysyx_22040213_sext12to64___024root____Vdpiimwrap_ysyx_22040213_top__DOT__alu1__DOT__breakpoint_TOP(IData/*31:0*/ ebreak);

void Vysyx_22040213_sext12to64___024root___settle__TOP__2(Vysyx_22040213_sext12to64___024root* vlSelf) {
    if (false && vlSelf) {}  // Prevent unused
    Vysyx_22040213_sext12to64__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp;
    VL_DEBUG_IF(VL_DBG_MSGF("+    Vysyx_22040213_sext12to64___024root___settle__TOP__2\n"); );
    // Body
    vlSelf->ysyx_22040213_top__DOT__ext_imm = (((- (QData)((IData)(
                                                                   (vlSelf->inst 
                                                                    >> 0x1fU)))) 
                                                << 0xcU) 
                                               | (QData)((IData)(
                                                                 (vlSelf->inst 
                                                                  >> 0x14U))));
    if ((0x13U == (0x7fU & vlSelf->inst))) {
        if ((0U == (7U & (vlSelf->inst >> 0xcU)))) {
            vlSelf->ysyx_22040213_top__DOT__wdata = 
                (((0U != (0x1fU & (vlSelf->inst >> 0xfU)))
                   ? vlSelf->ysyx_22040213_top__DOT__reg1__DOT__rf
                  [(0x1fU & (vlSelf->inst >> 0xfU))]
                   : 0ULL) + vlSelf->ysyx_22040213_top__DOT__ext_imm);
            vlSelf->ysyx_22040213_top__DOT__waddr = 
                (0x1fU & (vlSelf->inst >> 7U));
        } else {
            vlSelf->ysyx_22040213_top__DOT__wdata = 
                ((0U != (0x1fU & (vlSelf->inst >> 0x14U)))
                  ? vlSelf->ysyx_22040213_top__DOT__reg1__DOT__rf
                 [(0x1fU & (vlSelf->inst >> 0x14U))]
                  : 0ULL);
        }
    } else if ((0x73U == (0x7fU & vlSelf->inst))) {
        if ((1ULL == vlSelf->ysyx_22040213_top__DOT__ext_imm)) {
            Vysyx_22040213_sext12to64___024root____Vdpiimwrap_ysyx_22040213_top__DOT__alu1__DOT__breakpoint_TOP(1U);
        }
    } else {
        vlSelf->ysyx_22040213_top__DOT__waddr = 0U;
    }
}

void Vysyx_22040213_sext12to64___024root___eval_initial(Vysyx_22040213_sext12to64___024root* vlSelf) {
    if (false && vlSelf) {}  // Prevent unused
    Vysyx_22040213_sext12to64__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp;
    VL_DEBUG_IF(VL_DBG_MSGF("+    Vysyx_22040213_sext12to64___024root___eval_initial\n"); );
    // Body
    vlSelf->__Vclklast__TOP__clk = vlSelf->clk;
}

void Vysyx_22040213_sext12to64___024root___eval_settle(Vysyx_22040213_sext12to64___024root* vlSelf) {
    if (false && vlSelf) {}  // Prevent unused
    Vysyx_22040213_sext12to64__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp;
    VL_DEBUG_IF(VL_DBG_MSGF("+    Vysyx_22040213_sext12to64___024root___eval_settle\n"); );
    // Body
    Vysyx_22040213_sext12to64___024root___settle__TOP__2(vlSelf);
    vlSelf->__Vm_traceActivity[2U] = 1U;
    vlSelf->__Vm_traceActivity[1U] = 1U;
    vlSelf->__Vm_traceActivity[0U] = 1U;
}

void Vysyx_22040213_sext12to64___024root___final(Vysyx_22040213_sext12to64___024root* vlSelf) {
    if (false && vlSelf) {}  // Prevent unused
    Vysyx_22040213_sext12to64__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp;
    VL_DEBUG_IF(VL_DBG_MSGF("+    Vysyx_22040213_sext12to64___024root___final\n"); );
}

void Vysyx_22040213_sext12to64___024root___ctor_var_reset(Vysyx_22040213_sext12to64___024root* vlSelf) {
    if (false && vlSelf) {}  // Prevent unused
    Vysyx_22040213_sext12to64__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp;
    VL_DEBUG_IF(VL_DBG_MSGF("+    Vysyx_22040213_sext12to64___024root___ctor_var_reset\n"); );
    // Body
    vlSelf->clk = 0;
    vlSelf->rst = 0;
    vlSelf->inst = 0;
    vlSelf->pc = 0;
    vlSelf->ysyx_22040213_top__DOT__ext_imm = 0;
    vlSelf->ysyx_22040213_top__DOT__wdata = 0;
    vlSelf->ysyx_22040213_top__DOT__waddr = 0;
    for (int __Vi0=0; __Vi0<32; ++__Vi0) {
        vlSelf->ysyx_22040213_top__DOT__reg1__DOT__rf[__Vi0] = 0;
    }
    for (int __Vi0=0; __Vi0<3; ++__Vi0) {
        vlSelf->__Vm_traceActivity[__Vi0] = 0;
    }
}
